/**
 * 
 */
package edu.avans.hartigehap.service.jpa;

import java.util.Collection;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.google.common.collect.Lists;

import edu.avans.hartigehap.domain.Ingredient;
import edu.avans.hartigehap.domain.MenuItem;
import edu.avans.hartigehap.domain.decorator.MenuItemWithIngredient;
//import edu.avans.hartigehap.domain.decorator.PizzaBasic;
import edu.avans.hartigehap.repository.IngredientRepository;
import edu.avans.hartigehap.repository.MenuItemRepository;
import edu.avans.hartigehap.repository.MenuItemWithIngredientsRepository;
import edu.avans.hartigehap.service.MenuItemWithIngredientService;
import edu.avans.hartigehap.service.PizzaService;

/**
 * @author Chris
 *
 */

@Service("menuItemWithIngredient")
@Repository
@Transactional

public class MenuItemWithIngredientServiceImpl implements MenuItemWithIngredientService
{
	final Logger logger = LoggerFactory.getLogger(MenuItemWithIngredientServiceImpl.class);
	
	@Autowired
	private MenuItemWithIngredientsRepository menuItemWithIngredientsRepository;

	@Override
	public List<MenuItemWithIngredient> findAllMenuItemWithIngredient() {
		// TODO Auto-generated method stub
		return Lists.newArrayList(menuItemWithIngredientsRepository.findAll());
	}

	@Override
	public MenuItemWithIngredient findMenuItemWithIngredientById(String name) {
		// TODO Auto-generated method stub
		return menuItemWithIngredientsRepository.findOne(name);
	}

	@Override
	public MenuItemWithIngredient save(
			MenuItemWithIngredient menuItemWithIngredient) {
		// TODO Auto-generated method stub
		return menuItemWithIngredientsRepository.save(menuItemWithIngredient);
	}

	@Override
	public void delete(String name) {
		// TODO Auto-generated method stub
		menuItemWithIngredientsRepository.delete(name);
		
	}
	
	

}
